/*
 * RSFloatArray.h
 *
 *  Created on: 2010/03/17
 *      Author: alexandre
 */

#ifndef RSFLOATARRAY_H_
#define RSFLOATARRAY_H_

#include "RSArrayElement.h"
#include <QVector>

namespace Realsphere {

    class RSFloatArray : public Realsphere::RSArrayElement {
        Q_OBJECT
        public:
            RSFloatArray ();
            RSFloatArray ( const QString& rId );
            RSFloatArray ( const QString& rId, const QString& rName );
            RSFloatArray ( const float rArray[] );
            RSFloatArray ( const float rArray[], const QString& rId );
            RSFloatArray ( const float rArray[], const QString& rId, const QString& rName );
            RSFloatArray ( const float* rArray, unsigned int rSize );
            RSFloatArray ( const float* rArray, unsigned int rSize , const QString& rId );
            RSFloatArray ( const float* rArray, unsigned int rSize , const QString& rId, const QString& rName );

            ~RSFloatArray ();
        public:

            RSArrayElementType              ArrayType () const;
            int                             Count () const;
            RSDataPointer                   DataPointer ();
            RSDataSize                      SizeOf () const;
            QString                         ToString () const;

        public slots:
            void                            Clear( bool rEmit = true );
            void                            Append ( const RSValueElement& rValue, bool rEmit = true );
            void                            Append ( const RSFloat& rValue, bool rEmit = true );
            void                            Append ( const float& rValue, bool rEmit = true );
            void                            Append ( const float  rValue[], bool rEmit = true );
            void                            Append ( const float* rValue, unsigned int rSize, bool rEmit = true );
            void                            Remove ( unsigned int rIndex, bool rEmit = true );
            void                            Remove ( unsigned int rIndex, unsigned int rSize, bool rEmit = true );
            void                            SetValue ( unsigned int rIndex, const RSValueElement& rValue, bool rEmit = true );
            void                            SetValue ( unsigned int rIndex, const RSFloat& rValue, bool rEmit = true );
            void                            SetValue ( unsigned int rIndex, const float& rValue, bool rEmit = true );

        public:
            float&                          operator[] ( int rIndex );
            const float&                    operator[] ( int rIndex ) const;

        private:
            QVector<float>                 mData;
    };
}

#endif /* RSFLOATARRAY_H_ */
